<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="scripts/login/css/style.css" />
    <script src="scripts/jquery/js/jquery-1.6.2.min.js"></script>
    <script src="scripts/jquery/js/jquery-ui-1.8.16.custom.min.js"></script>
    <script src="scripts/customInput.jquery.js"></script>
    <script src="scripts/login/js/login.js"></script>
    <script src="scripts/jquery/jquery.validate.js"></script>
    <link rel="stylesheet" href="scripts/jquery/css/ui-darkness/jquery-ui-1.8.16.custom.css" />
    
	<title>MDOC Management website</title>
    
<script type="text/javascript">
function getParameterByName(name)
{
  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  var regexS = "[\\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(window.location.href);
  if(results == null)
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}

$(document).ready(function(){
	var error = getParameterByName("error");
	
	$('#loginBtn').button();
	
	var button = $('#loginButton');
	var box = $('#loginBox');
	
	if(error == "bad_login"){
		box.toggle();
		button.toggleClass('active');
        alert("Bad username or password, please try again!");
        $('#name').focus();
        return false;
	}
	
	if(error == "auth"){
		box.toggle();
		button.toggleClass('active');
        alert("you are not allowed to visit this page, please sign in!" );
        $('#name').focus();
        return false;
	}
	
	$("#loginBtn").click(function(){
		box.toggle();
		button.toggleClass('active');
		$('#name').focus();
	});
});
</script>
</head>
<body>
    <div id="bar">
        <div id="container">
            <!-- Login Starts Here -->
            <div id="title">MDOC Project</div>
            <div id="loginContainer">
                <a href="#" id="loginButton"><span>Login</span><em></em></a>
                <div style="clear:both"></div>
                <div id="loginBox">                
                    <form id="loginForm" action="authentification.do" method="post">
                        <fieldset id="body">
                            <fieldset>
                                <label for="email">Username</label>
                                <input type="text" name="name" id="name" />
                            </fieldset>
                            <fieldset>
                                <label for="password">Password</label>
                                <input type="password" name="password" id="password" />
                            </fieldset>
                            <input type="submit" id="login" value="Sign in" />
                            <label for="checkbox"><input type="checkbox" id="checkbox" />Remember me</label>
                        </fieldset>
                        <span><a href="#">Forgot your password?</a></span>
                    </form>
                    
                </div>
            </div>
            <!-- Login Ends Here -->
		</div>
	</div>
	<div class="content">
		<div class="container">
		<center>
			<h1>Welcome to the MDOC management website</h1>
			<h3>Please login to access to the admin page.</h3>
			<br/>
			<br/>
			<br/>
			<br/>
			<br/>
			<button type="button" id="loginBtn" value="Sign in" text="login">Sign in</button>
		</center>
		</div>
    
    
    </div>

</body>
</html>
